#include <iostream>
#include<stack>
#include<conio.h>

using namespace std;

void copy_stack( stack<int> *x, stack<int> *y)
{

  int pom;
  if ( (*x).empty()) return;

   pom = (*x).top();  (*x).pop();

   copy_stack(x,y);
   (*y).push(pom);



}

void draw_stack( stack<int> X)
{
cout<<"......................................................................."<<endl;
while(!X.empty())
{
    cout<<X.top()<<endl;
    X.pop();
}
cout<<"......................................................................."<<endl;
}
void draw_top (stack<int> x)
{
    if( !x.empty() ) cout<< x.top();
    cout<< " ";
}

void  hanoi(stack<int> &a,stack<int> &b,stack<int> &c,int il)     //    (*a).top()
{
int pom;


if( il>1 ) hanoi(a,c,b,il-1);

pom =a.top() ;a.pop(); c.push(pom);

if (il>1)  hanoi(b,a,c,il-1);

}



int main()
{
int nr=4;
stack<int> A,B,C;

A.push(4),A.push(3),A.push(2),A.push(1);

hanoi(A,B,C,nr);


/*cout<< "A" <<endl;draw_stack(A);
cout<< "B" <<endl;draw_stack(B);*/


cout<< "C" <<endl;draw_stack(C);



    return 0;
}
